#ifndef _COMM_H_
#define _COMM_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ipc.h>
#include <sys/types.h>
#include <sys/msg.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

#define MSG_LENGTH 1024

#define FIFO_PATH "/tmp/cmd2shell"

struct msgbuf
{
    long msgtype;
    char msgtext[MSG_LENGTH];
};

int createMsgQueue();
int getMsgQueue();
int destoryMsgQueue(int msg_id);
int sendMsgQueue(int msg_id, char* msg);
int recvMsgQueue(int msg_id, char out[]);
int createFIFOPipe();
int removeFIFOPipe();
int readFIFOPipe(char output[], int size);
int writeFIFOPipe(char input[], int size);

#endif
